
public class Connector
{
	DataOfPlayer[] dop;
	String message;
	int maxBet;
	Connector(DataOfPlayer[] dop)
	{
		this.dop=dop;
		maxBet=0;
	}
	//Name and Type
	public void setType(int id, int type)
	{
		dop[id].setType(type);
	}
	public void setName(int id, String name)
	{
		dop[id].setName(name);
	}
	//State
	public void changeState(int id, int state)
	{
		dop[id].changeState(state);
	}
	public int getState(int id)
	{
		return dop[id].getState();
	}
	//Cards
	public String getChange(int id)
	{
		return dop[id].getChange();
	}
	public void changeCards(int id, int change[]) throws BadugiException
	{
		dop[id].changeCards(change);
	}
	public String getCards(int id)
	{
		String[] cards = dop[id].getCards();
		return cards[0]+":"+cards[1]+":"+cards[2]+":"+cards[3];
	}
	public int getTokens(int id)
	{
		return dop[id].getTokens();
	}
	public void updateTokens(int id, int tokens)
	{
		dop[id].updateTokens(tokens);
	}
	public int getBet(int id)
	{
		return dop[id].getBet();
	}
	public void updateBet(int id, int bet)
	{
		dop[id].updateBet(bet);
	}
	public int getMaxBet()
	{
		return maxBet;
	}
	public void updateMaxBet(int bet)
	{
		maxBet=bet;
	}
	//Messenger All Message
	public void setMessage(String message)
	{
		this.message=message;
	}
	public String getMessage()
	{
		return message;
	}
	public void killSerwer()
	{
		try
		{
			Thread.sleep(1000);
		}
		catch(InterruptedException ex)
		{
			System.out.println("Ktos chyba zostal sila wyrwany ze snu!");
		}
		System.exit(0);
	}
}
